import Vue from 'vue'
import VueRouter from 'vue-router'

import Recommend from '../views/Recommend.vue'
import Tops from '../views/Tops.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Recommend',
    component: Recommend
  },
  {
    path: '/Recommend',
    name: 'Recommend',
    component: Recommend
  },
  {
    path: '/Tops',
    name: 'Tops',//热歌榜
    component: Tops
  },
  {
    path: '/TopDetail',
    name: 'TopDetail',//热歌榜详情
    component: ()=>import('@/views/TopDetail.vue')
  },
  {
    path: '/SongDetail',
    name: 'SongDetail',//歌曲详情
    component: ()=>import('@/views/SongDetail.vue')
  },
  {
    path: '/Topic',
    name: 'Topic',//歌单专题
    component: ()=>import('@/views/Topic.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

// router.beforeEach((to,from,next)=>{
//   debugger
//   next();
// })
// router.afterEach((to,from)=>{
//   debugger
// })

export default router
